import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: '/layout/homepage',
    },
    {
      path: '/layout',
      component: () => import('@/views/layout/index.vue'),
      children: [
        {
          path: 'homepage',
          component: () => import('@/views/layout/HomePage/index.vue')
        },
        {
          path: 'category',
          component: () => import('@/views/layout/Category/index.vue')
        }
      ]
    },
    {
      path: '/login',
      component: () => import('@/views/login/index.vue')
    }
  ],
})

export default router
